package com.sunwayworld.basemodule.basedata.knowledgelibrary.service.impl;

import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.sunwayworld.basemodule.basedata.experimentinfo.bean.LimsExperimentInformationBean;
import com.sunwayworld.basemodule.basedata.experimentinfo.service.LimsExperimentInformationService;
import com.sunwayworld.basemodule.basedata.knowledgelibrary.bean.LimsKnowledgelibraryBean;
import com.sunwayworld.basemodule.basedata.knowledgelibrary.dao.LimsKnowledgelibraryDao;
import com.sunwayworld.basemodule.basedata.knowledgelibrary.service.LimsKnowledgelibraryService;
import com.sunwayworld.basemodule.basedata.remarknote.bean.LimsRemarkNoteBean;
import com.sunwayworld.basemodule.basedata.remarknote.service.LimsRemarkNoteService;
import com.sunwayworld.framework.at.annotation.AuditTrailEntry;
import com.sunwayworld.framework.at.annotation.AuditTrailType;
import com.sunwayworld.framework.context.ApplicationContextHelper;
import com.sunwayworld.framework.context.LocalContextHelper;
import com.sunwayworld.framework.data.page.Page;
import com.sunwayworld.framework.database.sql.Order;
import com.sunwayworld.framework.exception.InvalidDataException;
import com.sunwayworld.framework.i18n.I18nHelper;
import com.sunwayworld.framework.mybatis.mapper.MapperParameter;
import com.sunwayworld.framework.mybatis.mapper.MatchPattern;
import com.sunwayworld.framework.mybatis.mapper.SearchFilter;
import com.sunwayworld.framework.restful.data.RestJsonWrapperBean;
import com.sunwayworld.framework.spring.annotation.GikamBean;
import com.sunwayworld.module.item.file.bean.CoreFileBean;
import com.sunwayworld.module.item.file.manager.CoreFileManager;
import com.sunwayworld.module.item.file.service.CoreFileService;
import com.sunwayworld.module.item.notification.bean.CoreNotificationInstanceBean;
import com.sunwayworld.module.item.notification.service.CoreNotificationInstanceService;
import com.sunwayworld.module.sys.todo.bean.CoreTodoDTO;
import com.sunwayworld.module.sys.todo.service.CoreTodoService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Lazy;
import org.springframework.context.i18n.LocaleContextHolder;
import org.springframework.stereotype.Repository;
import org.springframework.transaction.annotation.Transactional;

import java.time.Duration;
import java.time.LocalDateTime;
import java.time.Period;
import java.util.List;
import java.util.Optional;
import java.util.stream.Collectors;

@Repository
@GikamBean
public class LimsKnowledgelibraryServiceImpl implements LimsKnowledgelibraryService {

    @Autowired
    private LimsKnowledgelibraryDao limsKnowledgelibraryDao;

    @Autowired
    private LimsRemarkNoteService limsRemarkNoteService;

    @Autowired
    private LimsExperimentInformationService limsExperimentInformationService;

    @Autowired
    private CoreTodoService coreTodoService;

    @Autowired
    private CoreNotificationInstanceService coreNotificationInstanceService;

    @Autowired
    @Lazy
    private CoreFileService coreFileService;

    @Lazy
    @Autowired
    private CoreFileManager fileManager;

    @Override
    @SuppressWarnings("unchecked")
    public LimsKnowledgelibraryDao getDao() {
        return limsKnowledgelibraryDao;
    }

    @Override
    @Transactional
    @AuditTrailEntry(AuditTrailType.INSERT)
    public Long insert(RestJsonWrapperBean jsonWrapper) {
        LimsKnowledgelibraryBean limsKnowledgelibrary = jsonWrapper.parseUnique(LimsKnowledgelibraryBean.class);
        limsKnowledgelibrary.setId(ApplicationContextHelper.getNextIdentity());
        limsKnowledgelibrary.setActiveStatus("1");
        getDao().insert(limsKnowledgelibrary);
        return limsKnowledgelibrary.getId();
    }

    @Override
    public JSONObject setActiveStatus(RestJsonWrapperBean jsonWrapperBean) {
        JSONObject req = new JSONObject();

        String activeStatus = jsonWrapperBean.getParamValue("activeStatus");
        List<LimsKnowledgelibraryBean> datas = jsonWrapperBean.parse(LimsKnowledgelibraryBean.class);

        if (activeStatus != null && !datas.isEmpty()) {
            List<Long> updateIds = datas.stream().map(LimsKnowledgelibraryBean::getId).collect(Collectors.toList());
            LimsKnowledgelibraryBean updateBean = new LimsKnowledgelibraryBean();
            updateBean.setActiveStatus(activeStatus);
            getDao().updateByIds(updateBean, updateIds, "activeStatus");
        }

        return req;
    }

    @Override
    public JSONObject saveAuthorizedPeople(RestJsonWrapperBean jsonWrapperBean) {
        JSONObject req = new JSONObject();

        String authorizedPeople = jsonWrapperBean.getParamValue("authorizedPeople");
        String authorizedPeopleIds = jsonWrapperBean.getParamValue("authorizedPeopleIds");
        List<LimsKnowledgelibraryBean> datas = jsonWrapperBean.parse(LimsKnowledgelibraryBean.class);

        if (authorizedPeople != null && authorizedPeopleIds != null && !datas.isEmpty()) {
            List<Long> updateIds = datas.stream().map(LimsKnowledgelibraryBean::getId).collect(Collectors.toList());

            LimsKnowledgelibraryBean updateBean = new LimsKnowledgelibraryBean();
            updateBean.setAuthorizedPeople(authorizedPeople);
            updateBean.setAuthorizedPeopleIds(authorizedPeopleIds);
            getDao().updateByIds(updateBean, updateIds, "authorizedPeople", "authorizedPeopleIds");
        }

        return req;
    }

    @Override
    public JSONObject refreshHomePageData(RestJsonWrapperBean jsonWrapperBean) {
        JSONObject req = new JSONObject();
        String userId = LocalContextHelper.getLoginUserId();

        MapperParameter knowledgeLibraryParam = new MapperParameter();
        knowledgeLibraryParam.put("filterByAuthorize", LocalContextHelper.getLoginUserId());
        List<LimsKnowledgelibraryBean> limsKnowledgelibraryBeans = selectList(knowledgeLibraryParam);

        List<LimsRemarkNoteBean> remarkNoteBeans = limsRemarkNoteService.selectListByFilter(SearchFilter.instance().match("createdById", userId).filter(MatchPattern.EQ), Order.desc("createdTime"));
        List<LimsExperimentInformationBean> experimentInformationBeans = limsExperimentInformationService.selectAll();

        JSONArray limsKnowledgelibraryArray = new JSONArray();
        limsKnowledgelibraryBeans.forEach(i -> {
            JSONObject row = new JSONObject();
            row.put("id", i.getId());
            row.put("fileType", i.getFileType());
            row.put("fileName", i.getFileName());
            row.put("fileSize", i.getFileSize());
            row.put("type", i.getType());
            row.put("flag", false);
            limsKnowledgelibraryArray.add(row);
        });
        req.put("limsKnowledgelibraryArray", limsKnowledgelibraryArray);

        JSONArray remarkNoteArray = new JSONArray();
        remarkNoteBeans.forEach(i -> {
            JSONObject row = new JSONObject();
            row.put("id", i.getId());
            row.put("remarkNote", i.getRemarkNote());
            row.put("createdTime", i.getCreatedTime());
            row.put("flag", false);
            remarkNoteArray.add(row);
        });
        req.put("remarkNoteArray", remarkNoteArray);

        JSONArray experimentInformationArray = new JSONArray();
        experimentInformationBeans.forEach(i -> {
            JSONObject row = new JSONObject();
            row.put("id", i.getId());
            row.put("picture", i.getPicture());
            row.put("description", i.getDescription());
            row.put("title", i.getTitle());
            row.put("flag", false);
            experimentInformationArray.add(row);
        });
        req.put("experimentInformationArray", experimentInformationArray);

        Page<CoreTodoDTO> todos = coreTodoService.selectCurrentUserTodoList(null, false, false);
        List<CoreTodoDTO> todoListAll = todos.getRows();
        List<CoreTodoDTO> todoList = todoListAll.stream().filter(t -> t.getQty() > 0).collect(Collectors.toList());

        JSONArray todoArray = new JSONArray();
        JSONArray todoArrayRow = new JSONArray();
        for (int i = 0; i < todoList.size(); i++) {
            JSONObject row = new JSONObject();
            row.put("menuId", todoList.get(i).getMenuId());
            row.put("modelName", I18nHelper.getMessage(todoList.get(i).getModelName()));
            row.put("href", todoList.get(i).getHref());
            row.put("qty", todoList.get(i).getQty());
            row.put("orderNo", todoList.get(i).getOrderNo());
            row.put("todoiconurl", todoList.get(i).getExt$Item("todoiconurl"));
            row.put("flag", false);
            todoArrayRow.add(row);
            if (((i + 1) % 8 == 0) || i == todoList.size() - 1) {
                todoArray.add(todoArrayRow);
                todoArrayRow = new JSONArray();
            }
        }
        req.put("todoArray", todoArray);

        JSONArray notificationArray = new JSONArray();
        List<CoreNotificationInstanceBean> notificationMessageDTOList = coreNotificationInstanceService.selectAll();
        notificationMessageDTOList.forEach(i -> {
            JSONObject row = new JSONObject();
            row.put("id", i.getId());
            row.put("title", i.getTitle());
            row.put("content", i.getContent());
            row.put("menuId", i.getMenuId());
            row.put("pageUrl", i.getPageUrl());
            row.put("menuName", i.getMenuName());
            if (i.getCreatedTime() != null) {
                Duration duration = Duration.between(i.getCreatedTime(), LocalDateTime.now());
                long days = duration.toDays(); //相差的天数
                long weeks = days / 7;
                if (weeks >= 1) {
                    if (weeks <= 4) {
                        row.put("daysToNow", String.format("%d%s", weeks, I18nHelper.getMessage("HOMEPAGE.TITLE.WEEKSAGO")));
                    } else {
                        row.put("daysToNow", String.format("%d%s", Period.between(i.getCreatedTime().toLocalDate(), LocalDateTime.now().toLocalDate()).getMonths(), I18nHelper.getMessage("HOMEPAGE.TITLE.MONTHSAGO")));
                    }
                } else {
                    row.put("daysToNow", String.format("%d%s", days, I18nHelper.getMessage("HOMEPAGE.TITLE.DAYSAGO")));
                }
            }
//            row.put("importanceFlag", "重要");
            row.put("importanceFlag", "普通");

            notificationArray.add(row);
        });
        req.put("notificationArray", notificationArray);

        JSONObject menuNames = new JSONObject();
        menuNames.put("locale", LocaleContextHolder.getLocale());
        menuNames.put("todoTitle", I18nHelper.getMessage("HOMEPAGE.TITLE.TODOS"));
        menuNames.put("notificationTitle", I18nHelper.getMessage("HOMEPAGE.TITLE.NOTIFICATIONS"));
        menuNames.put("experimentInformationTitle", I18nHelper.getMessage("HOMEPAGE.TITLE.EXPERIMENTINFORMATIONS"));
        menuNames.put("knowledgeLibraryTitle", I18nHelper.getMessage("HOMEPAGE.TITLE.KNOWLEDGELIBRARYS"));
        menuNames.put("remarkNoteTitle", I18nHelper.getMessage("HOMEPAGE.TITLE.REMARKNOTES"));

        menuNames.put("fileTypeTitle", I18nHelper.getMessage("HOMEPAGE.TITLE.FILETYPE"));
        menuNames.put("fileSizeTitle", I18nHelper.getMessage("HOMEPAGE.TITLE.FILESIZE"));
        menuNames.put("fileNameTitle", I18nHelper.getMessage("HOMEPAGE.TITLE.FILENAME"));

        menuNames.put("contentTitle", I18nHelper.getMessage("HOMEPAGE.TITLE.CONTENTTITLE"));
        menuNames.put("addRemarkNoteTitle", I18nHelper.getMessage("HOMEPAGE.TITLE.ADDREMARKNOTETITLE"));

        menuNames.put("alertNoContent", I18nHelper.getMessage("HOMEPAGE.TITLE.ALERT.NOCONTENT"));
        menuNames.put("alertFail", I18nHelper.getMessage("HOMEPAGE.TITLE.ALERT.FAIL"));
        menuNames.put("alertOK", I18nHelper.getMessage("HOMEPAGE.TITLE.ALERT.OK"));

        menuNames.put("seeMoreButton", I18nHelper.getMessage("HOMEPAGE.TITLE.SEEMOREBUTTON"));
        menuNames.put("addButton", I18nHelper.getMessage("HOMEPAGE.TITLE.ADDBUTTON"));

        req.put("menuNames", menuNames);
        return req;
    }

    @Override
    public JSONObject insertRemarkNote(JSONObject data) {
        JSONObject req = new JSONObject();

        String remarkNote = data.getString("remarkNote");
        LimsRemarkNoteBean insertBean = new LimsRemarkNoteBean();
        insertBean.setId(ApplicationContextHelper.getNextIdentity());
        insertBean.setRemarkNote(remarkNote);
        limsRemarkNoteService.getDao().insert(insertBean);

        req.put("id", insertBean.getId());
        return req;
    }

    @Override
    public JSONObject deleteRemarkNote(JSONObject data) {
        JSONObject req = new JSONObject();

        Long deleteId = data.getLong("id");
        limsRemarkNoteService.getDao().delete(deleteId);
        req.put("status", "1");

        return req;
    }

    @Override
    public JSONObject updateRemarkNote(JSONObject data) {
        JSONObject req = new JSONObject();

        Long updateId = data.getLong("id");
        String remarkNote = data.getString("remarkNote");

        if (updateId != null) {
            LimsRemarkNoteBean updateBean = limsRemarkNoteService.selectById(updateId);
            if (updateBean != null) {
                updateBean.setRemarkNote(remarkNote);
                limsRemarkNoteService.getDao().update(updateBean, "remarkNote");
            } else {
                return insertRemarkNote(data);
            }
        } else {
            return insertRemarkNote(data);
        }

        req.put("status", "1");

        return req;
    }

    @Override
    public CoreFileBean selectCoreFileByRowId(Long rowId) {
        LimsKnowledgelibraryBean targetBean = selectById(rowId);
        if (targetBean != null) {
            List<CoreFileBean> coreFileBeans = coreFileService.selectListByFilter(SearchFilter.instance().match("id", targetBean.getFileId()).filter(MatchPattern.EQ));
            if (coreFileBeans.isEmpty()) {
                throw new InvalidDataException(I18nHelper.getMessage("CORE.MODULE.EQUIPT.FILEACQCONFIGS.TIP.UPLOAD_FILE"));
            } else {
                Optional<CoreFileBean> any = coreFileBeans.stream().filter(f -> "audit".equals(f.getBizCategory())).findAny();
                if (any.isPresent()) {
                    CoreFileBean file = any.get();
                    file.setDownloadUrl(fileManager.getDownloadUrl(file));
                    return file;
                }else{
                    throw new InvalidDataException(I18nHelper.getMessage("NOT.FIND.FILE"));
                }
            }
        }
        return null;
    }

    @Override
    public JSONObject refreshKnowledgeLibraryData(RestJsonWrapperBean jsonWrapperBean) {
        JSONObject req = new JSONObject();
        String userId = LocalContextHelper.getLoginUserId();

        MapperParameter knowledgeLibraryParam = new MapperParameter();
        knowledgeLibraryParam.put("filterByAuthorize", LocalContextHelper.getLoginUserId());
        List<LimsKnowledgelibraryBean> limsKnowledgelibraryBeans = selectList(knowledgeLibraryParam);

        JSONArray limsKnowledgelibraryArray = new JSONArray();
        limsKnowledgelibraryBeans.forEach(i -> {
            JSONObject row = new JSONObject();
            row.put("id", i.getId());
            row.put("fileType", i.getFileType());
            row.put("fileName", i.getFileName());
            row.put("fileSize", i.getFileSize());
            row.put("type", i.getType());
            row.put("flag", false);
            limsKnowledgelibraryArray.add(row);
        });

        JSONObject menuNames = new JSONObject();
        menuNames.put("fileType", I18nHelper.getMessage("HOMEPAGE.TITLE.FILETYPE"));
        menuNames.put("fileSize", I18nHelper.getMessage("HOMEPAGE.TITLE.FILESIZE"));
        menuNames.put("fileName", I18nHelper.getMessage("HOMEPAGE.TITLE.FILENAME"));
        menuNames.put("knowledgeLibraryTitle", I18nHelper.getMessage("HOMEPAGE.TITLE.KNOWLEDGELIBRARYS"));

        req.put("header", menuNames);
        req.put("FileList", limsKnowledgelibraryArray);

        return req;
    }

    @Override
    public JSONObject refreshRemarkNoteData(RestJsonWrapperBean jsonWrapperBean) {
        JSONObject req = new JSONObject();
        String userId = LocalContextHelper.getLoginUserId();

        List<LimsRemarkNoteBean> remarkNoteBeans = limsRemarkNoteService.selectListByFilter(SearchFilter.instance().match("createdById", userId).filter(MatchPattern.EQ), Order.desc("createdTime"));

        JSONArray remarkNoteArray = new JSONArray();
        remarkNoteBeans.forEach(i -> {
            JSONObject row = new JSONObject();
            row.put("id", i.getId());
            row.put("remarkNote", i.getRemarkNote());
            row.put("flag", false);
            remarkNoteArray.add(row);
        });

        JSONObject menuNames = new JSONObject();
        menuNames.put("remarkNoteTitle", I18nHelper.getMessage("HOMEPAGE.TITLE.REMARKNOTES"));
        menuNames.put("contentTitle", I18nHelper.getMessage("HOMEPAGE.TITLE.CONTENTTITLE"));
        menuNames.put("addRemarkNoteTitle", I18nHelper.getMessage("HOMEPAGE.TITLE.ADDREMARKNOTETITLE"));

//        menuNames.put("alertNoContent", I18nHelper.getMessage("HOMEPAGE.TITLE.ALERT.NOCONTENT"));
//        menuNames.put("alertFail", I18nHelper.getMessage("HOMEPAGE.TITLE.ALERT.FAIL"));
//        menuNames.put("alertOK", I18nHelper.getMessage("HOMEPAGE.TITLE.ALERT.OK"));

        menuNames.put("seeMoreButton", I18nHelper.getMessage("HOMEPAGE.TITLE.SEEMOREBUTTON"));
        menuNames.put("addButton", I18nHelper.getMessage("HOMEPAGE.TITLE.ADDBUTTON"));

        menuNames.put("addFail", I18nHelper.getMessage("HOMEPAGE.TITLE.ALERT.FAIL"));
        menuNames.put("addSuccess", I18nHelper.getMessage("HOMEPAGE.TITLE.ALERT.OK"));
        menuNames.put("deleteFail", I18nHelper.getMessage("HOMEPAGE.TITLE.ALERT.deleteFail"));
        menuNames.put("deleteSuccess", I18nHelper.getMessage("HOMEPAGE.TITLE.ALERT.deleteSuccess"));
        menuNames.put("contentIsNull", I18nHelper.getMessage("HOMEPAGE.TITLE.ALERT.NOCONTENT"));
        menuNames.put("inputContent", I18nHelper.getMessage("HOMEPAGE.TITLE.ALERT.inputContent"));

        req.put("header", menuNames);
        req.put("remarkNoteArray", remarkNoteArray);

        return req;
    }

    @Override
    public JSONObject refreshExperimentInformationData(RestJsonWrapperBean jsonWrapperBean) {
        JSONObject req = new JSONObject();
        String userId = LocalContextHelper.getLoginUserId();

        List<LimsExperimentInformationBean> experimentInformationBeans = limsExperimentInformationService.selectAll();

        JSONArray experimentInformationArray = new JSONArray();
        experimentInformationBeans.forEach(i -> {
            JSONObject row = new JSONObject();
            row.put("id", i.getId());
            row.put("picture", i.getPicture());
            row.put("description", i.getDescription());
            row.put("title", i.getTitle());
            row.put("flag", false);
            experimentInformationArray.add(row);
        });
        JSONObject menuNames = new JSONObject();
        menuNames.put("experimentInformationTitle", I18nHelper.getMessage("HOMEPAGE.TITLE.EXPERIMENTINFORMATIONS"));

        req.put("menuNames", menuNames);
        req.put("experimentInformationArray", experimentInformationArray);

        return req;
    }

    @Override
    public JSONObject refreshToDoData(RestJsonWrapperBean jsonWrapperBean) {
        JSONObject req = new JSONObject();
        String userId = LocalContextHelper.getLoginUserId();

        Page<CoreTodoDTO> todos = coreTodoService.selectCurrentUserTodoList(null, false, false);
        List<CoreTodoDTO> todoList = todos.getRows();

        JSONArray todoArray = new JSONArray();
        JSONArray todoArrayRow = new JSONArray();
        for (int i = 0; i < todoList.size(); i++) {
            JSONObject row = new JSONObject();
            row.put("menuId", todoList.get(i).getMenuId());
            row.put("modelName", I18nHelper.getMessage(todoList.get(i).getModelName()));
            row.put("href", todoList.get(i).getHref());
            row.put("qty", todoList.get(i).getQty());
            row.put("orderNo", todoList.get(i).getOrderNo());
            row.put("todoiconurl", todoList.get(i).getExt$Item("todoiconurl"));
            row.put("flag", false);
            todoArrayRow.add(row);
            if (((i + 1) % 8 == 0) || i == todoList.size() - 1) {
                todoArray.add(todoArrayRow);
                todoArrayRow = new JSONArray();
            }
        }
        req.put("todoArray", todoArray);

        return req;
    }

    @Override
    public JSONObject refreshNotificationData(RestJsonWrapperBean jsonWrapperBean) {
        JSONObject req = new JSONObject();
        String userId = LocalContextHelper.getLoginUserId();

        JSONArray notificationArray = new JSONArray();
//        List<CoreNotificationMessageDTO> notificationMessageDTOList = coreNotificationInstanceService.selectNotificationMessageList(new RestJsonWrapperBean());
        List<CoreNotificationInstanceBean> notificationMessageDTOList = coreNotificationInstanceService.selectAll();
        notificationMessageDTOList.forEach(i -> {
            JSONObject row = new JSONObject();
            row.put("id", i.getId());
            row.put("title", i.getTitle());
            row.put("content", i.getContent());
            row.put("viewMethod", i.getViewMethod());
            row.put("menuId", i.getMenuId());
            row.put("pageUrl", i.getPageUrl());
            row.put("menuName", i.getMenuName());
            row.put("createdTime", i.getCreatedTime());
            if (i.getCreatedTime() != null) {
                Duration duration = Duration.between(i.getCreatedTime(), LocalDateTime.now());
                long days = duration.toDays(); //相差的天数
                long weeks = days / 7;
                if (weeks >= 1) {
                    if (weeks <= 4) {
                        row.put("daysToNow", String.format("%d%s", weeks, I18nHelper.getMessage("HOMEPAGE.TITLE.WEEKSAGO")));
                    } else {
                        row.put("daysToNow", String.format("%d%s", Period.between(i.getCreatedTime().toLocalDate(), LocalDateTime.now().toLocalDate()).getMonths(), I18nHelper.getMessage("HOMEPAGE.TITLE.MONTHSAGO")));
                    }
                } else {
                    row.put("daysToNow", String.format("%d%s", days, I18nHelper.getMessage("HOMEPAGE.TITLE.DAYSAGO")));
                }
            }
//            row.put("importanceFlag", "重要");
            row.put("importanceFlag", "普通");

            notificationArray.add(row);
        });
        JSONObject menuNames = new JSONObject();
        menuNames.put("todoTitle", I18nHelper.getMessage("HOMEPAGE.TITLE.TODOS"));

        req.put("menuNames", menuNames);
        req.put("notificationArray", notificationArray);

        return req;
    }

    @Override
    public JSONObject refreshMenuNameData(RestJsonWrapperBean jsonWrapperBean) {

        JSONObject menuNames = new JSONObject();
        menuNames.put("locale", LocaleContextHolder.getLocale());
        menuNames.put("todoTitle", I18nHelper.getMessage("HOMEPAGE.TITLE.TODOS"));
        menuNames.put("notificationTitle", I18nHelper.getMessage("HOMEPAGE.TITLE.NOTIFICATIONS"));
        menuNames.put("experimentInformationTitle", I18nHelper.getMessage("HOMEPAGE.TITLE.EXPERIMENTINFORMATIONS"));
        menuNames.put("knowledgeLibraryTitle", I18nHelper.getMessage("HOMEPAGE.TITLE.KNOWLEDGELIBRARYS"));
        menuNames.put("remarkNoteTitle", I18nHelper.getMessage("HOMEPAGE.TITLE.REMARKNOTES"));

        menuNames.put("fileTypeTitle", I18nHelper.getMessage("HOMEPAGE.TITLE.FILETYPE"));
        menuNames.put("fileSizeTitle", I18nHelper.getMessage("HOMEPAGE.TITLE.FILESIZE"));
        menuNames.put("fileNameTitle", I18nHelper.getMessage("HOMEPAGE.TITLE.FILENAME"));

        menuNames.put("contentTitle", I18nHelper.getMessage("HOMEPAGE.TITLE.CONTENTTITLE"));
        menuNames.put("addRemarkNoteTitle", I18nHelper.getMessage("HOMEPAGE.TITLE.ADDREMARKNOTETITLE"));

        menuNames.put("alertNoContent", I18nHelper.getMessage("HOMEPAGE.TITLE.ALERT.NOCONTENT"));
        menuNames.put("alertFail", I18nHelper.getMessage("HOMEPAGE.TITLE.ALERT.FAIL"));
        menuNames.put("alertOK", I18nHelper.getMessage("HOMEPAGE.TITLE.ALERT.OK"));

        menuNames.put("seeMoreButton", I18nHelper.getMessage("HOMEPAGE.TITLE.SEEMOREBUTTON"));
        menuNames.put("addButton", I18nHelper.getMessage("HOMEPAGE.TITLE.ADDBUTTON"));

        return menuNames;
    }

}
